package com.imooc.sell.utils;

import java.util.Random;

public class KeyUtil {
  /**
   * 格式: 时间戳 + 6位随机数
   */
  public static synchronized String genUniqueKey() {
    Random random = new Random();
    Integer number = (int) ((Math.random() * 9 + 1) * 100000);
    return String.valueOf(number) + System.currentTimeMillis();
  }
}